<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue-组件</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

</head>

<body>
    <div id="app1">
        <h1>helloWorld! {{name}}</h1>
        <my-component></my-component>
        <my-component></my-component>
        <my-component></my-component>
        <my-component></my-component>
    </div>

    <script>
        //全局组件的使用
        // 1.创建组件构造器
        let Profile = Vue.extend({
            template: `
          <div>
            <input type="date"></input>  
            <p>flkjasfkj</p>
          </div>
        `
        });

        // 2.注册一个全局的组件
        Vue.component('myComponent', Profile);

        new Vue({
            // el: document.getElementById('app'),
            el: '#app',
            data: {
                name: 'zhou'
            }
        })
    </script>
</body>

</html>